import { Component,ElementRef, OnInit,Input,ViewChild, Output, EventEmitter,AfterViewInit} from '@angular/core';

import { Service } from '../../../server/server';
import { CudTableService } from '../../../public/serve/cud-table/cud-table.service';
import {JournalTableComponent } from '../../journal/journal-table/journal-table.component';
declare var $: any;

@Component({
  selector: 'app-journal-deletethree',
  templateUrl: './journal-deletethree.component.html'
})
export class JournalDeletethreeComponent implements OnInit {

  constructor(private server :Service,private tableListService:CudTableService) { }

  ngOnInit() {
  }

  //删除三个月前的
  deletethree(){
    let url = this.server.baseUrl+'admin/logs/deleteThree';
    this.tableListService.postRequest(url, {}).then((res: any)=>{
      $("#deletethree").modal("hide");
      if (res.result_code == '0000') {
        //console.log(res.result);
        this.server.journaldeletethreeentEmit.emit(true); 
        
        this.server.prompt = { prompt: true, success: true, fail: false, promptStatement: res.message };
        this.server.promptclose;
      } else {
        this.server.prompt = { prompt: true, success: false, fail: true, promptStatement: res.message };
        this.server.promptclose;
      }   
    }).catch();
  }

}
